﻿Imports System.Windows.Controls.DataVisualization.Charting

Public Class ConsumptionHistory

  Public Sub New()
    If Not BaseViewModel.IsInDesignModeStatic Then
      Me.DataContext = TotalConsumptionsVM.Instance
    End If
    ' This call is required by the designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.
    Chart1.DataContext = Me.DataContext
  End Sub

  Private Sub ConsumptionHistory_SizeChanged(sender As Object, e As SizeChangedEventArgs) Handles Me.SizeChanged
    If Me.ActualHeight < 300 Then
      FirstDateLarge.Visibility = Windows.Visibility.Collapsed
      SecondDateLarge.Visibility = Windows.Visibility.Collapsed
      FirstDateSmall.Visibility = Windows.Visibility.Visible
      SecondDateSmall.Visibility = Windows.Visibility.Visible
    Else
      FirstDateLarge.Visibility = Windows.Visibility.Visible
      SecondDateLarge.Visibility = Windows.Visibility.Visible
      FirstDateSmall.Visibility = Windows.Visibility.Collapsed
      SecondDateSmall.Visibility = Windows.Visibility.Collapsed
    End If
  End Sub
End Class
